package org.benjamin.tenancy.domain.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * 整栋楼建筑物
 */
@Entity
@Table(name = "tab_building")
public class Building extends EntitySuppert{

	//门牌号名称
    @Column(name = "name",unique = true)
    private String name;

    //整栋楼包含那些楼房
    @OneToMany
    @JoinColumn(name = "building_id")
    private List<Housing> housings = new ArrayList<>();

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<Housing> getHousings() {
		return housings;
	}

	public void setHousings(List<Housing> housings) {
		this.housings = housings;
	}
    
    

}
